package com.dust.yuheadline.common.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.dust.yuheadline.common.aliyun.utils.AliOssProperties;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * @author 高翔宇
 * @since 2024/5/2 周四 上午11:50
 */
@SpringBootConfiguration
@RequiredArgsConstructor
public class SpringConfiguration {
    private final AliOssProperties aliOssProperties;

    @Bean
    public OSS springContextHolder() {
        return new OSSClientBuilder().build(aliOssProperties.getEndpoint(), aliOssProperties.getAccessKey(), aliOssProperties.getAccessSecretKey());
    }
}
